<?php

class Application_Model_DbTable_Bloodgroup extends Zend_Db_Table_Abstract
{

    protected $_name = 'BloodGroup';
    protected $_primary = 'id';

    public function getBloodGroups()
    {
    	$rows = $this->fetchAll();
    	if (!$rows){
    		return null;
    	}
    	return $rows;
    }
    public function getBloodgroupForUser($id)
    {
    	try{
    		$id = (int)$id;
	    	$row = $this->fetchRow("id = " . $id);
	    	if (!$row) {
				return null;
			}
	    	return $row->toArray();
    	
    	}
    	catch (Zend_Exception $e) {  
			echo "Error message: " . $e->getMessage() . "\n";
        }
    
    }

}

